*"International Reputation Costs as a Mechanism for Credible Assurance? A Case of East Asia"
* Using Stata 16.0
log using JEPS_log, replace

clear
use JEPS_Data.dta

***Vairable Codings***
**Experimental Condition
gen condition=.
replace condition=1 if support_g1!=""
replace condition=2 if support_g2!=""
replace condition=3 if support_g3!=""
replace condition=4 if support_g4!=""
label define condition 1 "China/No Commitment" 2 "China/Commitment" 3 "Japan/No Commitmnet" 4 "Japan/Commitment"
label values condition condition
tab condition

**Demographics
*Gender
tab gender
g Male=.
replace Male=1 if gender=="Male"
replace Male=0 if gender=="Female"
tab Male

*Age
tab age
g Age=.
replace Age=1 if age>=18 & age<=24
replace Age=2 if age>=25 & age<=34
replace Age=3 if age>=35 & age<=44
replace Age=4 if age>=45 & age<=54
replace Age=5 if age>=55 & age<=64
replace Age=6 if age>=65
tab Age

label define Age 1 "18-24" 2 "25-34" 3 "35-44" 4 "45-54" 5 "55-64" 6 "65 or Over"
label values Age Age

*Race
tab race
g White=.
replace White=1 if race=="White"
replace White=0 if race=="Asian" | race=="Black" | race=="Mixed" | race=="Other" 
sum White
label define White 1 "White" 0 "Non Whites"
label values White White
tab White

*Ideology(Respondent)
tab ideology
g Ideology=.
replace Ideology=1 if ideolog=="Extremely Conservative"
replace Ideology=2 if ideolog=="Conservative"
replace Ideology=3 if ideolog=="Slightly Conservative"
replace Ideology=4 if ideolog=="Moderate, Middle of the Road"
replace Ideology=5 if ideolog=="Slightly Liberal"
replace Ideology=6 if ideolog=="Liberal"
replace Ideology=7 if ideolog=="Extremely Liberal"
tab Ideology
sum Ideology

label define Ideology 1 "Extremely Conservative" 2 "Conservative" 3 "Slightly Conservative" 4 "Moderate, Middle of the Road/Don't Know" 5 "Slightly Liberal" 6 "Liberal" 7 "Extremely Liberal"
label values Ideology Ideology
tab Ideology

*Income
tab income
g Income=.
replace Income=1 if income=="Less than $25,000"
replace Income=2 if income=="$25,000 - $49,999"
replace Income=3 if income=="$50,000 - $74,999"
replace Income=4 if income=="$75,000 - $99,999"
replace Income=5 if income=="$100,000 - $124,999"
replace Income=6 if income=="$125,000 - $149,999"
replace Income=7 if income=="$150,000 - $174,999"
replace Income=8 if income=="$175,000 - $199,999"
replace Income=9 if income=="More than $200,000"
tab Income

label define Income 1 "Less than $25,000" 2 "$25,000 - $49,999" 3 "$50,000 - $74,999" 4 "$75,000 - $99,999" 5 "$100,000 - $124,999" 6 "$125,000 - $149,999" 7 "$150,000 - $174,999" 8 "$175,000 - $199,999" 9 "More than $200,000"
label values Income Income
tab Income

*Education
tab education
gen Education=.
replace Education=1 if education=="Bachelor’s degree or higher"
replace Education=0 if education!="Bachelor’s degree or higher"
replace Education=. if education=="Prefer not to answer"

label define Education 1 "Bachelor’s degree or higher" 0 "Less than Bachelor’s degree"
label values Education Education
tab Education

*Partisanship
tab partisanship
g Democrat=.
replace Democrat=1 if partisanship=="Democrat"
replace Democrat=0 if partisanship!="Democrat"
replace Democrat=. if partisanship=="Prefer not to answer"
label define Democrat 1 "Democrat" 0 "Not Democrat"
label values Democrat Democrat
tab Democrat

g Republican=.
replace Republican=1 if partisanship=="Republican"
replace Republican=0 if partisanship!="Republican"
replace Republican=. if partisanship=="Prefer not to answer"
label define Republican 1 "Republican" 0 "Not Republican"
label values Republican Republican
tab Republican

*Voting
tab voting
gen Voting_Pres20=.
replace Voting_Pres20=1 if voting=="Yes"
replace Voting_Pres20=0 if voting=="No"
tab Voting_Pres20

*Feeling
tab feeling_china 
gen Feeling_China=.
replace Feeling_China=1 if feeling_china=="Very unfavorably"
replace Feeling_China=2 if feeling_china=="Somewhat unfavorably"
replace Feeling_China=3 if feeling_china=="Slightly unfavorably"
replace Feeling_China=4 if feeling_china=="Neither unfavorably nor favorably"
replace Feeling_China=5 if feeling_china=="Slightly favorably"
replace Feeling_China=6 if feeling_china=="Somewhat favorably"
replace Feeling_China=7 if feeling_china=="Strongly favorably"
tab Feeling_China

tab feeling_japan
gen Feeling_Japan=.
replace Feeling_Japan=1 if feeling_japan=="Very unfavorably"
replace Feeling_Japan=2 if feeling_japan=="Somewhat unfavorably"
replace Feeling_Japan=3 if feeling_japan=="Slightly unfavorably"
replace Feeling_Japan=4 if feeling_japan=="Neither unfavorably nor favorably"
replace Feeling_Japan=5 if feeling_japan=="Slightly favorably"
replace Feeling_Japan=6 if feeling_japan=="Somewhat favorably"
replace Feeling_Japan=7 if feeling_japan=="Strongly favorably"
tab Feeling_Japan

*Knowledge
tab knowledge_china
gen Knowledge_China=0
replace Knowledge_China=1 if knowledge_china=="XI Jinping"

tab knowledge_japan
gen Knowledge_Japan=0
replace Knowledge_Japan=1 if knowledge_japan=="Fumio Kishida"

*Commitment credibility (Contunious)
gen credibility=.
replace credibility=1 if credibility_g1=="Very unlikely"|credibility_g2=="Very unlikely"|credibility_g3=="Very unlikely"|credibility_g4=="Very unlikely"
replace credibility=2 if credibility_g1=="Somewhat unlikely"|credibility_g2=="Somewhat unlikely"|credibility_g3=="Somewhat unlikely"|credibility_g4=="Somewhat unlikely"
replace credibility=3 if credibility_g1=="Somewhat likely"|credibility_g2=="Somewhat likely"|credibility_g3=="Somewhat likely"|credibility_g4=="Somewhat likely"
replace credibility=4 if credibility_g1=="Very likely"|credibility_g1=="Very likely"|credibility_g3=="Very likely"|credibility_g4=="Very likely"

*Credibility (Dummy)
gen credibility_dummy=.
replace credibility_dummy=0 if credibility_g1=="Very unlikely"|credibility_g2=="Very unlikely"|credibility_g3=="Very unlikely"|credibility_g4=="Very unlikely"
replace credibility_dummy=0 if credibility_g1=="Somewhat unlikely"|credibility_g2=="Somewhat unlikely"|credibility_g3=="Somewhat unlikely"|credibility_g4=="Somewhat unlikely"
replace credibility_dummy=1 if credibility_g1=="Somewhat likely"|credibility_g2=="Somewhat likely"|credibility_g3=="Somewhat likely"|credibility_g4=="Somewhat likely"
replace credibility_dummy=1 if credibility_g1=="Very likely"|credibility_g1=="Very likely"|credibility_g3=="Very likely"|credibility_g4=="Very likely"

*Support Change?
gen support=.
replace support=1 if support_g1=="Strongly oppose"|support_g2=="Strongly oppose"|support_g3=="Strongly oppose"|support_g4=="Strongly oppose"
replace support=2 if support_g1=="Somewhat oppose"|support_g2=="Somewhat oppose"|support_g3=="Somewhat oppose"|support_g4=="Somewhat oppose"
replace support=3 if support_g1=="Don't care/ Neither support nor oppose"|support_g2=="Don't care/ Neither support nor oppose"|support_g3=="Don't care/ Neither support nor oppose"|support_g4=="Don't care/ Neither support nor oppose"
replace support=4 if support_g1=="Somewhat support"|support_g2=="Somewhat support"|support_g3=="Somewhat support"|support_g4=="Somewhat support"
replace support=5 if support_g1=="Strongly support"|support_g2=="Strongly support"|support_g3=="Strongly support"|support_g4=="Strongly support"

**Work with China/Japan?
gen collaborate=.
replace collaborate=1 if work_g1=="Strongly disagree"|work_g2=="Strongly disagree"|work_g3=="Strongly disagree"|work_g4=="Strongly disagree"
replace collaborate=2 if work_g1=="Somewhat disagree"|work_g2=="Somewhat disagree"|work_g3=="Somewhat disagree"|work_g4=="Somewhat disagree"
replace collaborate=3 if work_g1=="Don't care/ Neither agree nor disagree"|work_g2=="Don't care/ Neither agree nor disagree"|work_g3=="Don't care/ Neither agree nor disagree"|work_g4=="Don't care/ Neither agree nor disagree"
replace collaborate=4 if work_g1=="Somewhat agree"|work_g2=="Somewhat agree"|work_g3=="Somewhat agree"|work_g4=="Somewhat agree"
replace collaborate=5 if work_g1=="Strongly agree"|work_g2=="Strongly agree"|work_g3=="Strongly agree"|work_g4=="Strongly agree"

*Trust Government?
gen trust_gov=.
replace trust_gov=1 if trust_gov_g1=="Strongly distrust"|trust_gov_g2=="Strongly distrust"|trust_gov_g3=="Strongly distrust"|trust_gov_g4=="Strongly distrust"
replace trust_gov=2 if trust_gov_g1=="Somewhat distrust"|trust_gov_g2=="Somewhat distrust"|trust_gov_g3=="Somewhat distrust"|trust_gov_g4=="Somewhat distrust"
replace trust_gov=3 if trust_gov_g1=="Don't care/ Neither trust nor distrust"|trust_gov_g2=="Don't care/ Neither trust nor distrust"|trust_gov_g3=="Don't care/ Neither trust nor distrust"|trust_gov_g4=="Don't care/ Neither trust nor distrust"
replace trust_gov=4 if trust_gov_g1=="Somewhat trust"|trust_gov_g2=="Somewhat trust"|trust_gov_g3=="Somewhat trust"|trust_gov_g4=="Somewhat trust"
replace trust_gov=5 if trust_gov_g1=="Strongly trust"|trust_gov_g2=="Strongly trust"|trust_gov_g3=="Strongly trust"|trust_gov_g4=="Strongly trust"

*Trust Citizens?
gen trust_cit=.
replace trust_cit=1 if trust_cit_g1=="Strongly distrust"|trust_cit_g2=="Strongly distrust"|trust_cit_g3=="Strongly distrust"|trust_cit_g4=="Strongly distrust"
replace trust_cit=2 if trust_cit_g1=="Somewhat distrust"|trust_cit_g2=="Somewhat distrust"|trust_cit_g3=="Somewhat distrust"|trust_cit_g4=="Somewhat distrust"
replace trust_cit=3 if trust_cit_g1=="Don't care/ Neither trust nor distrust"|trust_cit_g2=="Don't care/ Neither trust nor distrust"|trust_cit_g3=="Don't care/ Neither trust nor distrust"|trust_cit_g4=="Don't care/ Neither trust nor distrust"
replace trust_cit=4 if trust_cit_g1=="Somewhat trust"|trust_cit_g2=="Somewhat trust"|trust_cit_g3=="Somewhat trust"|trust_cit_g4=="Somewhat trust"
replace trust_cit=5 if trust_cit_g1=="Strongly trust"|trust_cit_g2=="Strongly trust"|trust_cit_g3=="Strongly trust"|trust_cit_g4=="Strongly trust"

**Table 1
tab condition

**Table 2
ttest credibility if condition==1 | condition==2, by(condition)
ttest credibility_dummy if condition==1 | condition==2, by(condition)

**Table 3
ttest credibility if condition==3 | condition==4, by(condition)
ttest credibility_dummy if condition==3 | condition==4, by(condition)

**Multiple Comparison
anova credibility condition
pwcompare condition, effects sort mcompare(tukey)

anova credibility_dummy condition
pwcompare condition, effects sort mcompare(tukey)

**Tests for the Conditional Effect (Main Text and Table A4 in Appendix)
gen China_Commitment=0
replace China_Commitment=1 if condition==2
label define China_Commitmemt 0 "Extremely Conservative" 2 "Conservative" 3 "Slightly Conservative" 4 "Moderate, Middle of the Road/Don't Know" 5 "Slightly" 

gen Japan_NoCommitment=0
replace Japan_NoCommitment=1 if condition==3

gen Japan_Commitment=0
replace Japan_Commitment=1 if condition==4

reg credibility China_Commitment Japan_NoCommitment Japan_Commitment
estimates store Model1
lincom _b[China_Commitment]-(_b[Japan_Commitment]-_b[Japan_NoCommitment])

reg credibility_dummy China_Commitment Japan_NoCommitment Japan_Commitment
estimates store Model2
lincom _b[China_Commitment]+(_b[Japan_NoCommitment]-_b[Japan_Commitment])

*Alternavite: Interaction Terms (Table A4 in Appendix)
gen China=0
replace China=1 if condition==1|condition==2

gen Commitment=0
replace Commitment=1 if condition==2|condition==4

reg credibility i.China##i.Commitment
estimates store Model3

reg credibility_dummy i.China##i.Commitment
estimates store Model4

esttab Model1 Model2 Model3 Model4 using conditional_effect.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

**Table 4 and 5: Alternative Measures of International Reputation Costs
ttest support if condition==1 | condition==2, by(condition)
ttest support if condition==3 | condition==4, by(condition)

ttest collaborate if condition==1 | condition==2, by(condition)
ttest collaborate if condition==3 | condition==4, by(condition)

ttest trust_gov if condition==1 | condition==2, by(condition)
ttest trust_gov if condition==3 | condition==4, by(condition)

ttest trust_cit if condition==1 | condition==2, by(condition)
ttest trust_cit if condition==3 | condition==4, by(condition)

*Tests for the Conditional Effect (Table A5 in Appendix)
reg support China_Commitment Japan_NoCommitment Japan_Commitment
estimates store Model1
lincom _b[China_Commitment]-(_b[Japan_Commitment]-_b[Japan_NoCommitment])

reg collaborate China_Commitment Japan_NoCommitment Japan_Commitment
estimates store Model2
lincom _b[China_Commitment]+(_b[Japan_NoCommitment]-_b[Japan_Commitment])

reg trust_gov China_Commitment Japan_NoCommitment Japan_Commitment
estimates store Model3
lincom _b[China_Commitment]+(_b[Japan_NoCommitment]-_b[Japan_Commitment])

reg trust_cit China_Commitment Japan_NoCommitment Japan_Commitment
estimates store Model4
lincom _b[China_Commitment]+(_b[Japan_NoCommitment]-_b[Japan_Commitment])

esttab Model1 Model2 Model3 Model4 using conditional_effect.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

**Table A1: Descriptive Statistics
sum i.condition credibility support collaborate trust_gov trust_cit Male Age White Ideology Democrat Republican Voting_Pres20 Income Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan

**Table A2: Balance Check
ttesttable Male condition, ref(1) uneq
ttesttable Age condition, ref(1) uneq
ttesttable White condition, ref(1) uneq
ttesttable Democrat condition, ref(1) uneq
ttesttable Republican condition, ref(1) uneq
ttesttable Ideology condition, ref(1) uneq
ttesttable Voting_Pres20 condition, ref(1) uneq
ttesttable Income condition, ref(1) uneq
ttesttable Education condition, ref(1) uneq
ttesttable Feeling_China condition, ref(1) uneq
ttesttable Feeling_Japan condition, ref(1) uneq
ttesttable Knowledge_China condition, ref(1) uneq
ttesttable Knowledge_Japan condition, ref(1) uneq

**Table A3: Controlling for Demographic and Attitudinal Variables
reg credibility i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if condition==1 | condition==2
estimates store Model1

reg credibility_dummy i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if condition==1 | condition==2
estimates store Model2

reg credibility i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if condition==3 | condition==4
estimates store Model3

reg credibility_dummy i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if condition==3 | condition==4
estimates store Model4

esttab Model1 Model2 Model3 Model4 using covariants.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

**Tables A6 and A7: Exclude inattentive subjects
tab attention
sum durationinseconds, detail
g inattentive=0
replace inattentive=1 if durationinseconds<103 | durationinseconds>669
tab inattentive

*Continous
reg credibility i.condition if inattentive==0 & (condition==1 | condition==2)
estimates store Model1

reg credibility i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if inattentive==0 & (condition==1 | condition==2)
estimates store Model2

reg credibility i.condition if inattentive==0 & (condition==3 | condition==4)
estimates store Model3

reg credibility i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if inattentive==0 & (condition==3 | condition==4)
estimates store Model4

esttab Model1 Model2 Model3 Model4 using inattentive_continous.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

*Dichotomous
reg credibility_dummy i.condition if inattentive==0 & (condition==1 | condition==2)
estimates store Model5

reg credibility_dummy i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if inattentive==0 & (condition==1 | condition==2)
estimates store Model6

reg credibility_dummy i.condition if inattentive==0 & (condition==3 | condition==4)
estimates store Model7

reg credibility_dummy i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if inattentive==0 & (condition==3 | condition==4)
estimates store Model8

esttab Model5 Model6 Model7 Model8 using inattentive_dummy.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

**Tables 11-13: Manupulation Checks
tab m1
tab m2
gen manipulation=0
replace manipulation=1 if condition==1 & m1=="No" & m2=="No"
replace manipulation=1 if condition==2 & m1=="No" & m2=="Yes"
replace manipulation=1 if condition==3 & m1=="No" & m2=="No"
replace manipulation=1 if condition==4 & m1=="Yes" & m2=="No"
tab manipulation
tab condition manipulation, row chi2

*Continous
reg credibility i.condition if manipulation==1 & (condition==1 | condition==2)
estimates store Model1

reg credibility i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if manipulation==1 & (condition==1 | condition==2)
estimates store Model2

reg credibility i.condition if manipulation==1 & (condition==3 | condition==4)
estimates store Model3

reg credibility i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if manipulation==1 & (condition==3 | condition==4)
estimates store Model4

esttab Model1 Model2 Model3 Model4 using manipulation_continous.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

*Dichotomous
reg credibility_dummy i.condition if manipulation==1 & (condition==1 | condition==2)
estimates store Model5

reg credibility_dummy i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if manipulation==1 & (condition==1 | condition==2)
estimates store Model6

reg credibility_dummy i.condition if manipulation==1 & (condition==3 | condition==4)
estimates store Model7

reg credibility_dummy i.condition Male Age White Ideology Democrat Republican Income Voting_Pres20 Education Feeling_China Feeling_Japan Knowledge_China Knowledge_Japan if manipulation==1 & (condition==3 | condition==4)
estimates store Model8

esttab Model5 Model6 Model7 Model8 using manipulation_dummy.tex, replace se r2 legend label collabels(none) varlabels(_cons Constant) star(* 0.05 ** 0.01)

***Figues A1-A22: The Heterogenous Effect of Demographic and Attitudinal Variables
**Heterogenous Effect (China)
*Conditional Effect of Gender?
regress credibility i.condition##i.Male if condition==1 | condition==2

regress credibility i.condition if Male==0 & (condition==1 | condition==2)
estimates store NotMale

regress credibility i.condition if Male==1 & (condition==1 | condition==2)
estimates store Male

coefplot NotMale Male, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Male), size(medium))
graph export "china_male.pdf", replace

*Conditional Effect of Age?
sum Age
gen Old=.
replace Old=1 if Age>4
replace Old=0 if Age<=4
tab Old

regress credibility i.condition##i.Old if condition==1 | condition==2

regress credibility i.condition if Old==0 & (condition==1 | condition==2)
estimates store NotOld

regress credibility i.condition if Old==1 & (condition==1 | condition==2)
estimates store Old

coefplot NotOld Old, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Old), size(medium))
graph export "china_old.pdf", replace

*Conditional Effect of White?
regress credibility i.condition##i.White if condition==1 | condition==2

regress credibility i.condition if White==0 & (condition==1 | condition==2)
estimates store NotWhite

regress credibility i.condition if White==1 & (condition==1 | condition==2)
estimates store White

coefplot NotWhite White, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (White), size(medium))
graph export "china_white.pdf", replace

*Conditional Effect of Ideology?
sum Ideology
gen Liberal=.
replace Liberal=1 if Ideology>5
replace Liberal=0 if Ideology<=5
tab Liberal

regress credibility i.condition##i.Liberal if condition==1 | condition==2

regress credibility i.condition if Liberal==0 & (condition==1 | condition==2)
estimates store NotLiberal

regress credibility i.condition if Liberal==1 & (condition==1 | condition==2)
estimates store Liberal

coefplot NotLiberal Liberal, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Ideology), size(medium))
graph export "china_liberal.pdf", replace

*Conditional Effect of Democrat?
regress credibility i.condition##i.Democrat if condition==1 | condition==2

regress credibility i.condition if Democrat==0 & (condition==1 | condition==2)
estimates store NotDemocrat

regress credibility i.condition if Democrat==1 & (condition==1 | condition==2)
estimates store Democrat

coefplot NotDemocrat Democrat, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Democrat), size(medium))
graph export "china_democrat.pdf", replace

*Conditional Effect of Republican?
regress credibility i.condition##i.Republican if condition==1 | condition==2

regress credibility i.condition if Republican==0 & (condition==1 | condition==2)
estimates store NotRepublican

regress credibility i.condition if Republican==1 & (condition==1 | condition==2)
estimates store Republican

coefplot NotRepublican Republican, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Republican), size(medium))
graph export "china_republican.pdf", replace

*Conditional Effect of Voting in 2020 Presidential Election?
regress credibility i.condition##i.Voting_Pres20 if condition==1 | condition==2

regress credibility i.condition if Voting_Pres20==0 & (condition==1 | condition==2)
estimates store NotVoting_Pres20

regress credibility i.condition if Voting_Pres20==1 & (condition==1 | condition==2)
estimates store Voting_Pres20

coefplot NotVoting_Pres20 Voting_Pres20, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Voting), size(medium))
graph export "china_voting.pdf", replace

*Conditional Effect of Income?
sum Income
gen High_Income=.
replace High_Income=1 if Income>6
replace High_Income=0 if Income<=6
tab High_Income

regress credibility i.condition##i.High_Income if condition==1 | condition==2

regress credibility i.condition if High_Income==0 & (condition==1 | condition==2)
estimates store NotHigh_Income

regress credibility i.condition if High_Income==1 & (condition==1 | condition==2)
estimates store High_Income

coefplot NotHigh_Income High_Income, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Income), size(medium))
graph export "china_income.pdf", replace

*Conditional Effect of Education?
regress credibility i.condition##i.Education if condition==1 | condition==2

regress credibility i.condition if Education==0 & (condition==1 | condition==2)
estimates store NotBachelor

regress credibility i.condition if Education==1 & (condition==1 | condition==2)
estimates store Bachelor

coefplot NotBachelor Bachelor, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Education), size(medium))
graph export "china_education.pdf", replace

*Conditional Effect of Feeling toward China?
sum Feeling_China
gen Favorably_China=.
replace Favorably_China=1 if Feeling_China>5
replace Favorably_China=0 if Feeling_China<=5
tab Favorably_China

regress credibility i.condition##i.Favorably_China if condition==1 | condition==2

regress credibility i.condition if Favorably_China==0 & (condition==1 | condition==2)
estimates store NotFavorably_China

regress credibility i.condition if Favorably_China==1 & (condition==1 | condition==2)
estimates store Favorably_China

coefplot NotFavorably_China Favorably_China, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Feeling toward China), size(medium))
graph export "china_feeling.pdf", replace

*Conditional Effect of Knowledge on China?
regress credibility i.condition##i.Knowledge_China if condition==1 | condition==2

regress credibility i.condition if Knowledge_China==0 & (condition==1 | condition==2)
estimates store NotKnowledgable

regress credibility i.condition if Knowledge_China==1 & (condition==1 | condition==2)
estimates store Knowledgable

coefplot NotKnowledgable Knowledgable, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Knowledge (China)), size(medium))
graph export "china_knowledge.pdf", replace

**Heterogenous Effect (Japan)
*Conditional Effect of Gender?
regress credibility i.condition##i.Male if condition==3 | condition==4

regress credibility i.condition if Male==0 & (condition==3 | condition==4)
estimates store NotMale

regress credibility i.condition if Male==1 & (condition==3 | condition==4)
estimates store Male

coefplot NotMale Male, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Male), size(medium))
graph export "japan_male.pdf", replace

*Conditional Effect of Age?
regress credibility i.condition##i.Old if condition==3 | condition==4

regress credibility i.condition if Old==0 & (condition==3 | condition==4)
estimates store NotOld

regress credibility i.condition if Old==1 & (condition==3 | condition==4)
estimates store Old

coefplot NotOld Old, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Old), size(medium))
graph export "japan_old.pdf", replace

*Conditional Effect of White?
regress credibility i.condition##i.White if condition==3 | condition==4

regress credibility i.condition if White==0 & (condition==3 | condition==4)
estimates store NotWhite

regress credibility i.condition if White==1 & (condition==3 | condition==4)
estimates store White

coefplot NotWhite White, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (White), size(medium))
graph export "japan_white.pdf", replace

*Conditional Effect of Ideology?
regress credibility i.condition##i.Liberal if condition==3 | condition==4

regress credibility i.condition if Liberal==0 & (condition==3 | condition==4)
estimates store NotLiberal

regress credibility i.condition if Liberal==1 & (condition==3 | condition==4)
estimates store Liberal

coefplot NotLiberal Liberal, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Ideology), size(medium))
graph export "japan_liberal.pdf", replace

*Conditional Effect of Democrat?
regress credibility i.condition##i.Democrat if condition==3 | condition==4

regress credibility i.condition if Democrat==0 & (condition==3 | condition==4)
estimates store NotDemocrat

regress credibility i.condition if Democrat==1 & (condition==3 | condition==4)
estimates store Democrat

coefplot NotDemocrat Democrat, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Democrat), size(medium))
graph export "japan_democrat.pdf", replace

*Conditional Effect of Republican?
regress credibility i.condition##i.Republican if condition==3 | condition==4

regress credibility i.condition if Republican==0 & (condition==3 | condition==4)
estimates store NotRepublican

regress credibility i.condition if Republican==1 & (condition==3 | condition==4)
estimates store Republican

coefplot NotRepublican Republican, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Republican), size(medium))
graph export "japan_republican.pdf", replace

*Conditional Effect of Voting in 2020 Presidential Election?
regress credibility i.condition##i.Voting_Pres20 if condition==3 | condition==4

regress credibility i.condition if Voting_Pres20==0 & (condition==3 | condition==4)
estimates store NotVoting_Pres20

regress credibility i.condition if Voting_Pres20==1 & (condition==3 | condition==4)
estimates store Voting_Pres20

coefplot NotVoting_Pres20 Voting_Pres20, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Voting), size(medium))
graph export "japan_voting.pdf", replace

*Conditional Effect of Income?
regress credibility i.condition##i.High_Income if condition==3 | condition==4

regress credibility i.condition if High_Income==0 & (condition==3 | condition==4)
estimates store NotHigh_Income

regress credibility i.condition if High_Income==1 & (condition==3 | condition==4)
estimates store High_Income

coefplot NotHigh_Income High_Income, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Income), size(medium))
graph export "japan_income.pdf", replace

*Conditional Effect of Education?
regress credibility i.condition##i.Education if condition==3 | condition==4

regress credibility i.condition if Education==0 & (condition==3 | condition==4)
estimates store NotBachelor

regress credibility i.condition if Education==1 & (condition==3 | condition==4)
estimates store Bachelor

coefplot NotBachelor Bachelor, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Education), size(medium))
graph export "japan_education.pdf", replace

*Conditional Effect of Feeling toward Japan?
sum Feeling_Japan
gen Favorably_Japan=.
replace Favorably_Japan=1 if Feeling_Japan>5
replace Favorably_Japan=0 if Feeling_Japan<=5
tab Favorably_Japan

regress credibility i.condition##i.Favorably_Japan if condition==3 | condition==4

regress credibility i.condition if Favorably_Japan==0 & (condition==3 | condition==4)
estimates store NotFavorably_Japan

regress credibility i.condition if Favorably_Japan==1 & (condition==3 | condition==4)
estimates store Favorably_Japan

coefplot NotFavorably_Japan Favorably_Japan, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Feeling toward Japan), size(medium))
graph export "japan_feeling.pdf", replace

*Conditional Effect of Knowledge on Japan?
regress credibility i.condition##i.Knowledge_Japan if condition==3 | condition==4

regress credibility i.condition if Knowledge_Japan==0 & (condition==3 | condition==4)
estimates store NotKnowledgable

regress credibility i.condition if Knowledge_Japan==1 & (condition==3 | condition==4)
estimates store Knowledgable

coefplot NotKnowledgable Knowledgable, keep(*.condition) drop(_cons) xline(0) base title(Henerogenous Effect (Knowledge (Japan)), size(medium))
graph export "japan_knowledge.pdf", replace

log close